package com.demo.InitializingBean;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

@Component
public class InitializingBeanDemo implements InitializingBean {

    private int age;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行 afterPropertiesSet 方法！");
        age = 10;
    }

    public void test(){
        System.out.println(age);
    }
}
